import request from '@/utils/request'

/**
 * 查询数据
 * return promise
 */
export const list = searchPage => {
  return request({
    url: '/recruit/page',
    method: 'POST',
    searchPage
  })
}

/**
 * 新建
 * @param {*} job
 * @returns
 */
export const add = job => {
  return request({
    url: '/recruit',
    method: 'POST',
    job
  })
}

/**
 * 修改
 * @param {*} job
 * @returns
 */
export const modify = (job, id) => {
  return request({
    url: '/recruit/' + id,
    method: 'PUT',
    job
  })
}

/**
 * 删除
 * @param {*} ids
 */
export const deleteByIds = ids => {
  return request({
    url: '/recruit',
    method: 'DELETE',
    ids
  })
}

export const getObjectById = (type, id) => {
  return request({
    url: `/recruit/${type}/${id}`,
    method: 'GET'
  })
}
